package com.eascs.archive.service.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.dubbo.config.annotation.Service;
import com.eascs.admin.common.vo.ModelResult;
import com.eascs.app.dao.PageResult;
import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.archive.dao.ArchiveBorrowDao;
import com.eascs.archive.entity.ArchiveBorrowEntity;
import com.eascs.archive.entity.ArchiveRecordEntity;
import com.eascs.archive.service.ArchiveBorrowService;

@Service
public class ArchiveBorrowServiceImpl implements ArchiveBorrowService{
	protected final Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private ArchiveBorrowDao archiveBorrowDao;

	@Override
	public ModelResult<PageResult<Object[]>> queryListPage(ArchiveBorrowEntity entity, int pageSize, int pageIndex) {
		try {
			ModelResult<PageResult<Object[]>> modelResult=new ModelResult<>();
			PageResult<Object[]> pageResult=archiveBorrowDao.queryListPage(entity, pageSize, pageIndex);
			modelResult.setModel(pageResult);
			return modelResult;
		} catch (Exception e) {
		}
		return null;
	}

	@Override
	public Integer saveArchiveBorrowRecord(ArchiveBorrowEntity entity) {
		return archiveBorrowDao.insertArchiveBorrow(entity);
	}

	@Override
	public ArchiveBorrowEntity queryArchiveBorrowById(String bid) {
		return archiveBorrowDao.queryArchiveBorrowById(bid);
	}

	@Override
	public int deleteArchiveBorrowById(String bid) {
		return archiveBorrowDao.deleteArchiveBorrowById(bid);
	}

	@Override
	public List<ArchiveBorrowEntity> queryAllListByloanapplyNo(String loanapplyNo) {
		return archiveBorrowDao.queryAllListByloanapplyNo(loanapplyNo);
	}

	@Override
	public int updateArchiveBorrow(ArchiveBorrowEntity entity) {
		return archiveBorrowDao.updateArchiveBorrow(entity);
	}

	@Override
	public int updateArchiveBorrowRecordById(ArchiveBorrowEntity entity) {
		return archiveBorrowDao.updateArchiveBorrowRecordById(entity);
	}

	@Override
	public int updateBorrowState(String bid, String wfstate) {
		return archiveBorrowDao.updateBorrowState(bid, wfstate);
	}

	@Override
	public int saveSendBorrowInfo(ArchiveBorrowEntity entity) {
		return archiveBorrowDao.saveSendBorrowInfo(entity);
	}

	@Override
	public ArchiveRecordEntity queryArchiveExist(String loanapplyno) {
		return archiveBorrowDao.queryArchiveExist(loanapplyno);
	}

	
}
